﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Threading;
using Web.Framework;
using Core;

namespace Web.Areas.Admin.Controllers
{
    /// <summary>
    /// 控制面板
    /// </summary>
    [Authorize]
    public partial class ControlPanelController : BaseController
    {
        //
        // GET: /Manager/ControlPanel/
        public virtual ActionResult Index()
        {
            return View();
        }

        public virtual ActionResult AjaxTest()
        {
            Thread.Sleep(15000);
            return Content(DateTime.Now.ToString());
        }
        public virtual ActionResult Error()
        {
            return new HttpStatusCodeResult(500);
        }

        public virtual ActionResult ThrowException()
        {
            throw new Exception("错误了哦");
        }

        public virtual ActionResult ModelCheckException()
        {
            throw new ModelCheckException("123", "ModelCheckException");
        }

        public virtual ActionResult ViewMessageEx()
        {
            this.AddViewMessage(new Exception("ViewMessage抛出的异常"));
            return View("ViewMessage");
        }

        public virtual ActionResult ViewMessage()
        {
            this.AddViewMessage("ViewMessage的消息");
            return View("ViewMessage");
        }


    }
}
